package com.ellecity06.common.paging3.quick

import androidx.viewbinding.ViewBinding
import com.ellecity06.common.adapter.PagingLoadStateAdapter
import com.ellecity06.common.entity.MultiItem
import com.ellecity06.common.paging3.adapter.BaseMultiPagingAdapter

/**
 * @author ellecity06
 * @time 2023/4/24 15:51
 * @des
 */
class QuickAdapter<T : Any>(vararg itemHolder: Pair<Int, ItemHolder<T, QuickViewHolder<ViewBinding>>>) : BaseMultiPagingAdapter<T>() {
    init {
        withLoadStateFooter(PagingLoadStateAdapter())
        itemHolder.forEach {
            addItemHolder(it.first, it.second)
        }
        onItemViewType {
            if (it is MultiItem) it.viewType else 0
        }
    }

}